package com.itheima.reflect.proxy;

import java.lang.reflect.Proxy;

public class Test {

	public static void main(String[] args) {
		UserImpl ui = new UserImpl();
		ui.add();
		ui.delete();
		
		System.out.println("==========================");
		// 动态代理
		MyInvocationHandler h = new MyInvocationHandler(ui);
		User u = (User) Proxy.newProxyInstance(ui.getClass().getClassLoader(), ui.getClass().getInterfaces(), h);
		u.add();
		u.delete();
	}
}
